package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.dto.DriverOrderDTO;
import com.ruoyi.system.domain.vo.DriverOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DriverOrderMapper;
import com.ruoyi.system.domain.DriverOrder;
import com.ruoyi.system.service.IDriverOrderService;

/**
 * 货物运单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-16
 */
@Service
public class DriverOrderServiceImpl implements IDriverOrderService 
{
    @Autowired
    private DriverOrderMapper driverOrderMapper;

    /**
     * 查询货物运单
     * 
     * @param id 货物运单主键
     * @return 货物运单
     */
    @Override
    public DriverOrder selectDriverOrderById(Long id)
    {
        return driverOrderMapper.selectDriverOrderById(id);
    }

    /**
     * 查询货物运单列表
     * 
     * @param driverOrder 货物运单
     * @return 货物运单
     */
    @Override
    public List<DriverOrderVO> selectDriverOrderList(DriverOrderDTO driverOrder)
    {
        return driverOrderMapper.selectDriverOrderList(driverOrder);
    }

    /**
     * 新增货物运单
     * 
     * @param driverOrder 货物运单
     * @return 结果
     */
    @Override
    public int insertDriverOrder(DriverOrder driverOrder)
    {
        return driverOrderMapper.insertDriverOrder(driverOrder);
    }

    /**
     * 修改货物运单
     * 
     * @param driverOrder 货物运单
     * @return 结果
     */
    @Override
    public int updateDriverOrder(DriverOrder driverOrder)
    {
        return driverOrderMapper.updateDriverOrder(driverOrder);
    }

    /**
     * 批量删除货物运单
     * 
     * @param ids 需要删除的货物运单主键
     * @return 结果
     */
    @Override
    public int deleteDriverOrderByIds(Long[] ids)
    {
        return driverOrderMapper.deleteDriverOrderByIds(ids);
    }

    /**
     * 删除货物运单信息
     * 
     * @param id 货物运单主键
     * @return 结果
     */
    @Override
    public int deleteDriverOrderById(Long id)
    {
        return driverOrderMapper.deleteDriverOrderById(id);
    }

    @Override
    public double getDriverOrderPrice(DriverOrderDTO driverOrder) {
        return driverOrderMapper.getDriverOrderPrice(driverOrder);
    }
}
